package com.tony.demo.bean;

import com.puhui.lib.utils.JsonUtils;

import org.json.JSONObject;

/**
 * Copyright:
 * Created by TangJian on 2019/4/20.
 * Description:
 * Modified:
 */

public class AdvertisementInfo {
    private String id = "";

    private String title = "";

    private String imgUrl = "";

    private String linkUrl = "";

    public AdvertisementInfo(JSONObject jsonObject) {
        id = JsonUtils.getString(jsonObject, "id");
        title = JsonUtils.getString(jsonObject, "advTitle");
        imgUrl = JsonUtils.getString(jsonObject, "advImg");
        linkUrl = JsonUtils.getString(jsonObject, "advUrl");
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getImgUrl() {
        return imgUrl;
    }

    public void setImgUrl(String imgUrl) {
        this.imgUrl = imgUrl;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getLinkUrl() {
        return linkUrl;
    }

    public void setLinkUrl(String linkUrl) {
        if (linkUrl.endsWith("/")) {
            int length = linkUrl.length() - 1;
            linkUrl = linkUrl.substring(0, length);
        }
        this.linkUrl = linkUrl;
    }

}
